using System;

namespace NP.BPMReportPlatform.Entities.BPM_Business
{
    /// <summary>
    /// 物料改制明细表
    /// </summary> 
    public class MaterialReformDetails
    {
        /// <summary>
        /// 改制明细ID(主键)
        /// </summary> 
        public Guid ReformDetailsID { get; set; }

        /// <summary>
        /// 业务唯一键
        /// </summary>
        public Guid BusinessKey { get; set; }

        /// <summary>
        /// MRP控制者
        /// </summary>
        public string MRPController { get; set; }

        /// <summary>
        /// 退货单号
        /// </summary>
        public string ReturnOrderCode { get; set; }


        /// <summary>
        /// 成品物料编码
        /// </summary>
        public string MaterielCode { get; set; }

        /// <summary>
        /// 批次
        /// </summary>
        public string BatchCode { get; set; }

        /// <summary>
        /// 库位
        /// </summary>
        public string Location { get; set; }


        /// <summary>
        /// 成品物料名称
        /// </summary>
        public string MaterielName { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public decimal? Number { get; set; }

        /// <summary>
        /// 单位 为空默认为dr，否则使用传入的单位
        /// </summary>
        public string Unit { get; set; }

        /// <summary>
        /// 生产日期
        /// </summary>
        public DateTime? ManufactureDate { get; set; }

        /// <summary>
        /// 单价
        /// </summary> 
        public decimal? UnitPrice { get; set; }

        /// <summary>
        /// 金额(总金额)
        /// </summary>
        public decimal? TotalAmount { get; set; }

        /// <summary>
        /// 大小量纲
        /// </summary>
        public string Size { get; set; }

        /// <summary>
        /// 是否合格
        /// </summary>
        public string IsQualified { get; set; }


        /// <summary>
        /// 可请调数量
        /// </summary>
        public decimal? CanQuantityNumber { get; set; }


        /// <summary>
        /// 改制工厂
        /// </summary>
        public string ReformFactoryCode { get; set; }

        /// <summary>
        /// 改制原因
        /// </summary>
        public string ReformReason { get; set; }

        /// <summary>
        /// 改制数量
        /// </summary>
        public decimal? ReformNumber { get; set; }


        /// <summary>
        /// 掺用半成品名称
        /// </summary>
        public string SemiMaterielName { get; set; }

        /// <summary>
        /// 掺用半成品单价
        /// </summary>
        public decimal? SemiHalfUnitPrice { get; set; }

        /// <summary>
        /// 成本中心
        /// </summary>
        public string CostCenterCode { get; set; }


        /// <summary>
        /// 掺用半成品编码
        /// </summary>
        public string SemiMaterielCode { get; set; }


        /// <summary>
        /// 改制期限
        /// </summary>
        public DateTime? ReformDate { get; set; }

        /// <summary>
        /// 掺用比例
        /// </summary>
        public string BlendingRatio { get; set; }

        /// <summary>
        /// 是否有差异
        /// </summary>
        public string IsDiff { get; set; }

        /// <summary>
        /// 成品实物数量
        /// </summary>
        public decimal? ProductNumber { get; set; }

        /// <summary>
        /// 成品差异
        /// </summary>
        public decimal? ProductDiff { get; set; }

        /// <summary>
        /// 已请调数量
        /// </summary>
        public decimal? HasQuantityNumber { get; set; }

        /// <summary>
        /// 状态
        /// 0-可请调
        /// 1-已请调完成
        /// 2-不合格
        /// 3-改制数量为0
        /// 4-成品实物数量为0
        /// 5-已过期
        /// </summary>
        public int? State { get; set; } = 0;

        /// <summary>
        /// 状态名
        /// </summary>
        public string StateName { get; set; }


        /// <summary>
        /// 外键
        /// </summary>
        public Guid ReformID { get; set; }

        /// <summary>
        /// 改制主流程编号
        /// </summary>
        public string MainInstanceId { get; set; }

        /// <summary>
        /// 1-主流程 2-子流程
        /// </summary>
        public int? Type { get; set; }


        /// <summary>
        /// 请调数量
        /// </summary> 
        public decimal? QuantityNumber { get; set; }

        /// <summary>
        /// 调出库位
        /// </summary>
        public string LocationOut { get; set; }

        /// <summary>
        /// 调入库位
        /// </summary>
        public string LocationIn { get; set; }

        /// <summary>
        /// 转换完成时间
        /// </summary>
        public DateTime? TransformFinishDate { get; set; }

        /// <summary>
        /// 凭证号
        /// </summary>
        public string Vender { get; set; }

        /// <summary>
        /// 掺用半成品理论数量
        /// </summary>
        public decimal? SemiHalfTheoryNumer { get; set; }

        /// <summary>
        /// 掺用半成品数量（KG）
        /// </summary>
        public decimal? SemiHalfNumer { get; set; }

        /// <summary>
        /// 掺用半成品批次
        /// </summary>
        public string SemiHalfBatchCode { get; set; }

        /// <summary>
        /// 加工费
        /// </summary>
        public decimal? ProcessCost { get; set; }

        /// <summary>
        /// 金额
        /// </summary>
        public decimal? Amount { get; set; }

        /// <summary>
        /// 金额差异
        /// </summary>
        public decimal? AmountDiff { get; set; }

        /// <summary>
        /// 完成日期
        /// </summary>
        public DateTime? FinishDate { get; set; }


        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public string CreateUser { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public string CreateUserName { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 更新人工号
        /// </summary>
        public string UpdateUser { get; set; }


        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 是否复检
        /// </summary>
        public string IsReInspect { get; set; }


        /// <summary>
        /// 附件 (id)
        /// </summary>
        public string Attachment { get; set; }

        /// <summary>
        /// 附件名称
        /// </summary>
        public string AttachmentFileName { get; set; }


        /// <summary>
        /// 附件id
        /// </summary>
        public string AttachmentFileId { get; set; }

        /// <summary>
        /// 加工费工厂
        /// </summary>
        public string ProcessCostCenterFactory { get; set; }

        /// <summary>
        /// 加工费成本中心
        /// </summary>
        public string ProcessCostCenter { get; set; }

        /// <summary>
        /// 加工费成本中心原因名称
        /// </summary>
        public string ProcessCostCenterReasonName { get; set; }

        /// <summary>
        /// 加工费成本中心原因代码
        /// </summary>
        public string ProcessCostCenterReasonCode { get; set; }

        // /// <summary>
        // /// 总可请调数量
        // /// 改制数量大于成品数量 则显示成品数量
        // /// 改制数量小于成品数量 则显示改制数量
        // /// </summary>
        // [JsonIgnore]
        // public decimal? TotalCanQuantityNumber
        // {
        //     get
        //     {
        //         if (ReformNumber > ProductNumber)
        //         {
        //             return ProductNumber;
        //         }
        //         else
        //         {
        //             return ReformNumber;
        //         }
        //     }
        // }
      
    }
}